<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::resource('/','IndexController');

Route::resource('articel','ArticelController');
				 
//后台路由

Route::group(['namespace' => 'Admin','prefix' => 'admin'] , function(){

	// 认证路由...
	Route::get('auth/login',['as' => 'admin.login' , 'uses' =>  'LoginController@Login']);
	Route::post('auth/loginIn' , [ 'as' => 'admin.auth.loginIn','uses'=>'LoginController@LoginIn']);
	Route::get('auth/logout', 'LoginController@Logout');

	Route::group(['middleware' => 'auth'] , function(){
		Route::get('home',['as' => 'admin.home','uses' => 'SiteController@index']);

		Route::resource('categories','CategoriesController',['names' =>[
				'index'	 	=> 'admin.categories.index',
				'create' 	=> 'admin.categories.create',
				'stroe'  	=> 'admin.categories.store',
				'show'	 	=> 'admin.categories.show',
				'update' 	=> 'admin.categories.update',
				'edit'	 	=> 'admin.categories.edit',
				'destroy'	=> 'admin.categories.destroy'
			],
		]);

		Route::resource('articel','ArticelController',['names' =>[
				'index'	 	=> 'admin.articel.index',
				'create' 	=> 'admin.articel.create',
				'stroe'  	=> 'admin.articel.store',
				'show'	 	=> 'admin.articel.show',
				'update' 	=> 'admin.articel.update',
				'edit'	 	=> 'admin.articel.edit',
				'destroy'	=> 'admin.articel.destroy'
			],
		]);

		Route::resource('nav','NavController',['names' =>[
				'index'	 	=> 'admin.nav.index',
				'create' 	=> 'admin.nav.create',
				'stroe'  	=> 'admin.nav.store',
				'show'	 	=> 'admin.nav.show',
				'update' 	=> 'admin.nav.update',
				'edit'	 	=> 'admin.nav.edit',
				'destroy'	=> 'admin.nav.destroy'
			],
		]);

		Route::resource('banner','BannerController',['names' =>[
				'index'	 	=> 'admin.banner.index',
				'create' 	=> 'admin.banner.create',
				'stroe'  	=> 'admin.banner.store',
				'show'	 	=> 'admin.banner.show',
				'update' 	=> 'admin.banner.update',
				'edit'	 	=> 'admin.banner.edit',
				'destroy'	=> 'admin.banner.destroy'
			],
		]);

		Route::post('images/upload', ['as' => 'admin.images.upload', 'uses' => 'ImageController@upload']);
		
		Route::post('images/preview', ['as' => 'admin.images.preview', 'uses' => 'ImageController@preview']);

	});
});








